<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Index extends CI_Controller {
	public $theme_name = 'ultimate';
	
	function __construct() {
		parent::__construct();
		$this->load->model('category_model');
		$this->load->model('page_model');
		$this->load->model('post_model');
		//$this->load->model('taxonomy_model');
	}
	
	// home page
	public function index() {
		$data['mt'] = 'Home page';
		$data['md'] = '';
		$this->load->view(THEME_NAME.'/home', $data);
	}
	
	// category page
	public function category($category_slug) {
		$data['mt'] = 'Category page';
		$data['md'] = '';
		
		if(file_exists('themes/'.THEME_NAME.'/category-'.$category_slug.'.php')) {
			$this->load->view(THEME_NAME.'/category-'.$category_slug, $data);
		}else{
			$this->load->view(THEME_NAME.'/category', $data);
		}
	}
	
	// taxonomy page
	public function taxonomy($taxonomy_slug) {
		$data['mt'] = 'Taxonomy page';
		$data['md'] = '';
		
		if(file_exists('themes/'.THEME_NAME.'/taxonomy-'.$taxonomy_slug.'.php')) {
			$this->load->view(THEME_NAME.'/taxonomy-'.$taxonomy_slug, $data);
		}else{
			$this->load->view(THEME_NAME.'/taxonomy', $data);
		}
	}
	
	// single page
	public function single($post_type = '') {
		$data['mt'] = 'Single page';
		$data['md'] = '';
		
		
	}
	
	public function page($page_slug = '') {
		$data['mt'] = 'Page page';
		$data['md'] = '';
	}
	
	public function search() {
		$data['mt'] = 'Search page';
		$data['md'] = '';
		
		$this->load->view(THEME_NAME.'/search', $data);
	}
	
	public function not_found() {
		$data['mt'] = '404 page';
		$data['md'] = '';
		
		$this->load->view(THEME_NAME.'/404', $data);
	}
}